<?php
class CentroDist extends AppModel {

	var $name = 'CentroDist';

	//The Associations below have been created with all possible keys, those that are not needed can be removed
	/*var $belongsTo = array(
		'Empresa' => array(
			'className' => 'Empresa',
			'foreignKey' => 'empresa_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Representante1TipoDoc' => array(
			'className' => 'Representante1TipoDoc',
			'foreignKey' => 'representante1_tipo_doc_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Representante1Ubigeo' => array(
			'className' => 'Representante1Ubigeo',
			'foreignKey' => 'representante1_ubigeo_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Representante2TipoDoc' => array(
			'className' => 'Representante2TipoDoc',
			'foreignKey' => 'representante2_tipo_doc_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Representante2Ubigeo' => array(
			'className' => 'Representante2Ubigeo',
			'foreignKey' => 'representante2_ubigeo_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'UsuarioCreacion' => array(
			'className' => 'UsuarioCreacion',
			'foreignKey' => 'usuario_creacion_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'UsuarioModificacion' => array(
			'className' => 'UsuarioModificacion',
			'foreignKey' => 'usuario_modificacion_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'UsuarioBorrado' => array(
			'className' => 'UsuarioBorrado',
			'foreignKey' => 'usuario_borrado_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);*/

    function getCodigoNextel($id){
        $centro = $this->find('first', array(
            'fields'=>array('codigo_nextel'),
            'conditions'=>array('id'=>$id),
            'recursive'=>-1
        ));
        return $centro['CentroDist']['codigo_nextel'];
    }

}
?>